package com.dahua.messagesyncbj.business;

import com.dahua.messagesyncbj.util.StringUtil;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

@AllArgsConstructor
@NoArgsConstructor
public enum DeviceType {
    ZFJ(1,"ZFJ"),
    SLFJ(2,"SLFJ"),
    XDC(3,"XDC"),
    SB(4,"SB"),
    BF(5,"BF"),
    TFKT(6,"TFKT");
    private int type;
    private String device;

    public static DeviceType getType(String key){
        for (DeviceType temp : DeviceType.values()){
            if (StringUtil.isExit(key, temp.device) != -1){
                return temp;
            }
        }
        return null;
    }
    public String getDevice(){
        return this.device;
    }
}
